import request from '@/util/request'
import store from '@/vuex/store'
export function getnewsInfoApi(list) {
    return request({
        url: 'newsinformation/getnewsInfo.do',
        method: 'post',
        data: {
            pageSize: list.pageSize,
            currentPage: list.currentPage,
            token: store.getters.token
        }
    })
}

export function addnewsInfoApi(list) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'newsinformation/addnewsInfo.do',
        method: 'post',
        data: value
    })
}
export function deleteNewsInfoApi(id) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: id
    }
    return request({
        url: 'newsinformation/deleteNewsInfo.do',
        method: 'post',
        data: value
    })
}
export function updatenewsInfoApi(news) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(news)
    }
    return request({
        url: 'newsinformation/updatenewsInfo.do',
        method: 'post',
        data: value
    })
}

export function selectLikeApi(data) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(data)
    }
    return request({
        url: 'newsinformation/selectLike.do',
        method: 'post',
        data: value
    })
}
